namespace Digitalmes.Domain.Entities.Mes.Productions;

/// <summary>
/// 批次物料上料。
/// </summary>
[SugarTable("prod_batch_material_loading")]
public sealed class ProdBatchMaterialLoading : EntityBase
{
    /// <summary>
    /// 批次料条码。
    /// </summary>
    [NotNull]
    public string? Barcode { get; set; }

    /// <summary>
    /// 产线 Id。
    /// </summary>
    public long LineId { get; set; }

    /// <summary>
    /// 产线编号
    /// </summary>
    [NotNull]
    public string? LineCode { get; set; }

    /// <summary>
    /// 工位 Id。
    /// </summary>
    public long WorkstationId { get; set; }

    /// <summary>
    /// 工位编号
    /// </summary>
    [NotNull]
    public string? WorkstationCode { get; set; }

    /// <summary>
    /// 物料 Id。
    /// </summary>
    public long MaterialId { get; set; }

    /// <summary>
    /// 物料代码。
    /// </summary>
    [NotNull]
    public string? MaterialCode { get; set; }

    /// <summary>
    /// 批次料上料数量，为 0 时表示不计数。
    /// </summary>
    public int Qty { get; set; }

    /// <summary>
    /// 上料时间。
    /// </summary>
    public DateTime LoadingTime { get; set; }

    /// <summary>
    /// 上料人。
    /// </summary>
    public string? LoadingBy { get; set; }

    /// <summary>
    /// 是否已下料
    /// </summary>
    /// <remarks>下料后表示此次批次料不可用</remarks>
    public bool IsUnloading { get; set; }

    /// <summary>
    /// 下料人
    /// </summary>
    public string? UnloadingBy { get; set; }

    /// <summary>
    /// 下料时间
    /// </summary>
    public DateTime? UnloadingTime { get; set; }
}
